import request from '@/utils/request'

const prefixUrl = '/web/supplier/'

export function list(params) {
  return request({
    url: prefixUrl + 'list',
    method: 'get',
    params: params
  })
}

export function no_page_list(params) {
  return request({
    url: prefixUrl + 'no_page_list',
    method: 'get',
    params: params
  })
}

export function detail(params) {
  return request({
    url: prefixUrl + 'detail',
    method: 'get',
    params: params
  })
}

export function detail_material(params) {
  return request({
    url: prefixUrl + 'detail_material',
    method: 'get',
    params: params
  })
}

//结算周期字典
export function dict_pay_cycle() {
  return request({
    url: prefixUrl + 'dict_pay_cycle',
    method: 'get'
  })
}

//送货方式字典
export function dict_delivery_method() {
  return request({
    url: prefixUrl + 'dict_delivery_method',
    method: 'get'
  })
}

//材质字典
export function dict_material_texture() {
  return request({
    url: prefixUrl + 'dict_material_texture',
    method: 'get'
  })
}

export function add(data) {
  return request({
    url: prefixUrl + 'add',
    method: 'post',
    content_type: 'json',
    data: data
  })
}

export function edit(data) {
  return request({
    url: prefixUrl + 'edit',
    method: 'post',
    content_type: 'json',
    data: data
  })
}

export function remove(params) {
  return request({
    url: prefixUrl + 'delete',
    method: 'delete',
    params: params
  })
}

export function save_material(data) {
  return request({
    url: prefixUrl + 'save_material',
    method: 'post',
    content_type: 'json',
    data: data
  })
}

//根据材质id，查询供应商List
export function list_by_material_id(params) {
  return request({
    url: prefixUrl + 'list-by-material-id',
    method: 'get',
    params
  })
}
